/**
 * restful api 子路由
 */

const router = require('koa-router')()
const userInfoController = require('./../controllers/user-info')
const questionController = require('./../controllers/user-question')
const uploadPicture = require('./../controllers/upload')

const routers = router
  .post('/user/getUserInfo', userInfoController.getLoginUserInfo)
  .post('/user/signIn', userInfoController.signIn)
  .get('/user/logout', userInfoController.logout)
  .post('/user/addUser', userInfoController.signUp)
  .post('/user/list', questionController.qstList)
  .post('/user/likeList', questionController.Search)
  .post('/user/askDetil', questionController.askDetil)
  .post('/user/addAnswer', questionController.addAnswer)
  .post('/user/addAsk', questionController.addQuestions)
  .post('/user/uploadPicture', uploadPicture.uploadPic)
  .post('/user/getUserQst', questionController.SerchQst)
  .post('/user/UserQst', questionController.UserAddQst)
  .get('/user/getAllUsers', userInfoController.getAllUsers)
  .post('/user/DelUser', userInfoController.DelUser)
  .post('/user/ChangeAbout', userInfoController.ChangeAbout)

module.exports = routers
